﻿namespace NEvoWeb.Modules.NB_Store
{
    using DotNetNuke.Entities.Portals;
    using Microsoft.VisualBasic;
    using System;
    using System.Collections;
    using System.Web;

    public abstract class OptionInterface
    {
        private static OptionInterface objProvider = null;

        static OptionInterface()
        {
            CreateProvider();
        }

        protected OptionInterface()
        {
        }

        private static void CreateProvider()
        {
            string storeSetting = SharedFunctions.GetStoreSetting(((PortalSettings) HttpContext.Current.Items["PortalSettings"]).PortalId, "option.provider");
            if (storeSetting != "")
            {
                string[] strArray = Strings.Split(storeSetting, ",", -1, CompareMethod.Binary);
                objProvider = (OptionInterface) Activator.CreateInstance(strArray[0], strArray[1]).Unwrap();
            }
        }

        public virtual ArrayList GetOptionValueList(int PortalID, int OptionID, string Lang, ArrayList aryList)
        {
            return aryList;
        }

        public virtual string GetTextboxDefault(int PortalID, NB_Store_OptionInfo objInfo)
        {
            return "";
        }

        public static OptionInterface Instance()
        {
            return objProvider;
        }
    }
}

